import { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { getMapList } from '@renderer/redux/map.store'

export function useMap() {
  const dispatch = useDispatch()
  useEffect(() => {
    dispatch(getMapList())
  }, [])

  const mapList = useSelector((state) => {
    return state.map.mapList
  })

  return { mapList }
}
